<!DOCTYPE html>
<html>
	<head>
		<script src="../static/js/jquery-3.5.1.min.js" >
		</script>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var datas = new Object();
			var country="";
		</script>
		<script>
	    	$(document).ready(function(){
	    		country = window.parent.$("#textbox").val();
				$.ajax({
             	type: "POST",
             	url: "http://127.0.0.1:80/covid3.php",
             	data:"country="+country,
            	success: function(data){
                	$("#table1").empty();
					datas = JSON.parse(data);
		            for( var i = 0; i < datas.length; i++ ) {
		                var $trTemp = $("<tr></tr>");
		                $trTemp.append("<td class='tdbg'>"+ datas[i].国家 +"</td>");
		                $trTemp.append("<td class='tdbg'>"+ datas[i].现确诊人数 +"</td>");
		                $trTemp.append("<td class='tdbg'>"+ datas[i].确诊人数 +"</td>");
		                $trTemp.append("<td class='tdbg'>"+ datas[i].治愈人数 +"</td>");
		                $trTemp.append("<td class='tdbg'>"+ datas[i].死亡人数 +"</td>");
		                $trTemp.appendTo("#table1");
		            }
            	}
          		});
	    	});
    	</script>
    	<style>
    		.tdbg{
    			width: 300px;
    			height: 50px;
    			text-align: center;
    		}
    		.thbg{
    			background-color: #7ABAFF;
    			width: 300px;
    			height: 50px;
    		}
    	</style>
	</head>
	<body>
		<table border="1"cellspacing="0">
			<thead>
				<tr>
					<th class="thbg">国家/城市</th>
					<th class="thbg">现确诊人数</th>
					<th class="thbg">累计确诊</th>
					<th class="thbg">死亡人数</th>
					<th class="thbg">治愈人数</th>
				</tr>
			</thead>
			<tbody id="table1">
				
			</tbody>
		</table>
	</body>
</html>
